\documentclass[a4paper]{ctexart}
\usepackage{shellesc}
% \usepackage{pdftexcmds}
% \renewcommand{\pdfescapestring}{}
% \renewcommand{\pdfescapename}{}
% \renewcommand{\pdfescapehex}{}

% PDFLaTeX无法在命令行里用中文，还是用别的吧
% \begin{document}
    123
    % \pdfescapestring{中文}
    \makeatletter
    % \pdf@system{echo 中文中文2}
    % \pdf@escapestring{中文}
    % \pdf@unescapehexnative{echo \CTEX@char@nnn {228}{184}{173}\CTEX@char@nnn {230}{150}{135}}
    % \pdfprimitive\ShellEscape
    \immediate\write18{echo 中文} 
    \write-1{中文}
    % \pdf@write
% \end{document}